package tests;

import common.Untils;
import org.openqa.selenium.By;

import java.io.IOException;

public class HomePage extends Untils {
    public static String url = "http://8.155.1.153:8081/home";

    public HomePage() {
        super(url);
    }
    public void checkHomePage() throws IOException, InterruptedException {
        Thread.sleep(3000);
        //检查主要元素是否存在
        driver.findElement(By.xpath("//*[@id=\"sk-layout\"]/div/div/section/div[2]/header[2]/div/div[3]/div/div/div/div[1]"));
        driver.findElement(By.xpath("//*[@id=\"sk-layout\"]/div/div/section/div[2]/header[2]/div/div[3]/div/div/div/div[2]"));
        driver.findElement(By.xpath("//*[@id=\"sk-layout\"]/div/div/section/div[2]/header[2]/div/div[3]/div/div/div/span/div"));
        driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-tab-exam\"]"));
        driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-tab-survey\"]"));
        driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-tab-surveyHistory\"]"));
        driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-tab-examHistory\"]"));
        Thread.sleep(2000);
        driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-panel-exam\"]/div/div/div/div[1]/div/div[2]/div/div"));
        //找不到元素
//        driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-panel-surveyHistory\"]/div/div/div/div[1]/div/div[2]/div/div/div[1]"));
//        driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-panel-surveyHistory\"]/div/div/div/div[1]/div/div[2]/div/div/div[2]"));
//        driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-panel-surveyHistory\"]/div/div/div/div[1]/div/div[2]/div/div/div[3]"));
        screenshot(Thread.currentThread().getStackTrace()[1].getMethodName());
    }

}
